<?php


namespace app\staff\controller;

use app\admin\model\Seller;
use think\Db;


class Base extends Common
{
    public $staff_id = 0;
    public $shop_id = 0;

    public function __construct()
    {
        parent::__construct();
        $token = input('_token', '');
        if (!$token) {
            return $this->error('请先登录', [], -200);
        }
        $data = Db::name('staff')->where([
            'id' => $token,
        ])->find();
        if (!$data) {
            return $this->error('请先登录', [], -200);
        }
        $this->staff_id = $data['id'];
        $this->shop_id = $data['category_id'];
    }

    public function fangjianIds()
    {
        $ids = Db::name('fangjian')->where('category_id', $this->shop_id)->column('id');
        if ($ids) {
            return $ids;
        }
        return [-99];
    }

}
